function showIndex(obj) {
    var oDiv = document.getElementsByClassName("Meals-div"),
        count = oDiv.length;
    for (var i = 0; i < count; i++) {
        if (oDiv[i] == obj) {
            if($('.business1').eq(i).hasClass('hide1')){
                $(".business1").eq(i).show();
                $('.business1').eq(i).removeClass('hide1');
                $('.Meals-sp').eq(i).css('background-position-y','-8%');
            }else {
                $(".business1").eq(i).hide();
                $('.business1').eq(i).addClass('hide1');
                $('.Meals-sp').eq(i).css('background-position-y', '108%');
            }
        }
    }
}

//添加，删除
$(function(){
    var n=0;
    $(document).on('click', '.business-li', function(e) {
        var oDiv = document.createElement('div');
        $(this). parents('.buss').append(oDiv);
            oDiv.innerHTML =
                '<div class="business b-top business-b">'+
                '<ul class="business-ul">'+
                '<li class="fz9">'+
                '<span class="time-sp dis_in f5b">日期：</span>'+
                '<span class="time-sp1 fr dis_in f5"><input class="business-inp" name="timers" id="demo'+n+'" type="text" placeholder="请选择日期"></span>'+
                '</li>'+
                '<li class="fz9">'+
                '<span class="time-sp dis_in f5b">金额：</span>'+
                '<span class="time-sp1 fr dis_in f5"><input class="business-inp" name="money" id="inp1" type="text" placeholder="补贴标准：50/天"></span>'+
                '</li>'+
                '<li class="fz9">'+
                '<span class="time-sp dis_in f5b">招待场所：</span>'+
                '<span class="time-sp1 fr dis_in f5"><input id="Venue" name="Venue" class="business-inp" type="text"></span>'+
                '</li>'+
                '<li class="fz9">'+
                '<span class="time-sp dis_in f5b">招待单位：</span>'+
                '<span class="time-sp1 fr dis_in f5"><input class="business-inp"  name="Company" id="Company" type="text"></span>'+
                '</li>'+
                '<li class="fz9">'+
                '<span class="time-sp dis_in f5b">招待人数：</span>'+
                '<span class="time-sp1 fr dis_in f5"><input name="number" id="number" class="business-inp" type="text"></span>'+
                '</li>'+
                '</ul>'+
                '<textarea name="Remarks" id="txt1" cols="40" rows="10" placeholder="备注" ></textarea>'+
                '<ul class="business-ul2 fz9">'+
                '<li class="delete-b"><span class="delete">删除本条</span></li>'+
                '<li class="business-li"><span>添加餐费补贴</span></li>'+
                '</ul>'+
                '</div>';


        var calendar = new datePicker();
        calendar.init({
            'trigger': '#demo'+n+'', /*按钮选择器，用于触发弹出插件*/
            'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
            'minDate':'1900-1-1',/*最小日期*/
            'maxDate':'2100-12-31',/*最大日期*/
            'onSubmit':function(){/*确认时触发事件*/
                var theSelectData=calendar.value;
            },
            'onClose':function(){/*取消时触发事件*/
            }
        });
        n = n+1;

    });

    $(document).on('click', '.delete-b', function(e) {
        $(this).parents(".business-b").remove();
    });

});
    var n=0;
    var m=1;
    $(document).on('click', '.business-li', function(e) {
        var oDiv = document.createElement('div');
        $(this). parents('.bus1').append(oDiv);
        $(this). parents('.bus').append(oDiv);
        $(this). parents('.bus2').append(oDiv);
        $(this). parents('.bus3').append(oDiv);
        oDiv.innerHTML ='<div class="business travel-box1 b-top business-b">'+
            '<ul class="business-ul">'+
            '<li class="fz9">'+
            '<span class="time-sp dis_in f5b">'+'日期：'+"</span>"+
            '<span class="time-sp1 fr dis_in f5">'+
            '<input type="text" class="traffic-inp1" id="demo'+n+'" placeholder="请选择日期">'+'&nbsp;&nbsp;至&nbsp;&nbsp;'+
            '<input class="traffic-inp1" id="dem'+m+'" type="text" placeholder="请选择日期">'+'</span>'+
            '</li>'+
            '<li class="fz9">'+
            '<span class="time-sp dis_in f5b">金额：</span>'+
            '<span class="time-sp1 fr dis_in"><input class="business-inp traffic-inp fFF" type="text" placeholder="补贴标准：50元/天"></span>'+
            '</li>'+
            '</ul>'+
            '<textarea name="" class="txt1" cols="30" rows="6" placeholder="备注"></textarea>'+
            '<ul class="business-ul2 fz9">'+
            '<li class=" delete-b"><span class="delete">删除本条</span></li>' +
            '<li class="business-li"><span>添加餐费补贴</span></li>'+
            '</ul>'+
            '</div>';
        var calendar = new datePicker();
        calendar.init({
            'trigger': '#demo'+n+'', /*按钮选择器，用于触发弹出插件*/
            'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
            'minDate':'1900-1-1',/*最小日期*/
            'maxDate':'2100-12-31',/*最大日期*/
            'onSubmit':function(){/*确认时触发事件*/
                var theSelectData=calendar.value;
            },
            'onClose':function(){/*取消时触发事件*/
            }
    });
        var calendar = new datePicker();
        calendar.init({
            'trigger': '#dem'+m+'', /*按钮选择器，用于触发弹出插件*/
            'type': 'date',/*模式：date日期；datetime日期时间；time时间；ym年月；*/
            'minDate':'1900-1-1',/*最小日期*/
            'maxDate':'2100-12-31',/*最大日期*/
            'onSubmit':function(){/*确认时触发事件*/
                var theSelectData=calendar.value;
            },
            'onClose':function(){/*取消时触发事件*/
            }
        });
        n=n+1;m=m+1;
    $(document).on('click', '.delete-b', function(e) {
        $(this).parents(".business-b").remove();
    });

});
    //添加项目
$('.add-reimm ').click(function(){
    window.location.href='../Reimbursement/re-business.html';
});
$('.add-foot').click(function(){
    $('.background').show();
});
$('.sub-sp1').click(function(){
    $('.sub-success').show();
    $('.sub-tj').hide();
});
$('.cancel').click(function(){
    $('.background').hide();
});